$(document).ready(function () {
      
       setBackImg();

});

function setBackImg() {
	$(".loginBg").css("height",	window.screen.height)
}


function loginBtn() {
    const username = $("#username").val();
    const password = $("#password").val();
    if (username === "") {
        return alert("用户名不能为空")
    }
    if (password === "") {
        return alert("密码不能为空")
    }
    $.getJSON("http://192.168.199.231/WebServer/public/index.php/index/index/getuser?username=" + username + "&password=" + password,
            function (data) {
                console.log(data);
                const result = eval(data);
                console.log(result.code);
                if (result.code === 1) {
                    console.log(result.msg);
                    console.log(result.username);
                    console.log(result.password);
                    localStorage.username = result.username;
                    localStorage.password = result.password;
                    window.location.href = "../html/DocumentQuery.html";
                } else {
                    console.log("登陆失败");
                }

            });
}

// //是这个吗？对，用360浏览器搜索，
// function loginBtn() {
//     const username = $("#username").val();
//     const password = $("#password").val();
//     if (username === "") {
//         return alert("用户名不能为空")
//     }
//     if (password === "") {
//         return alert("密码不能为空")
//     }

    // $.post(loginApi, {username: username, password: hex_md5(password)},
    //         function (data, status) {
    //             console.log(data + status);
    //         });
// }

